
*** Replication code for "Presidential Elections and European Party Systems (1848-2020)" (Casal Bértoa/Weber in BJPolS)


clear all
use pres_elec_data


* Table 1

eststo M1: xtgls closure i.hos_mode enep party_inst dem_year growth i.el_sys_legis frac_ethn i.precur_regi, c(ar1) p(het)
eststo M2: xtgls enep i.hos_mode dem_year growth i.el_sys_legis frac_ethn i.precur_regi if closure<., c(ar1) p(het)
eststo M3: xtgls party_inst i.hos_mode dem_year growth i.el_sys_legis frac_ethn i.precur_regi if closure<., c(ar1) p(het)

estout M1 M2 M3 using tab1.doc, c(b(fmt(2) star) se(par fmt(2))) starl(+ 0.1 * 0.05 ** 0.01) eqlab(,none) s(rho chi2, fmt(2 0)) replace


* Table 2

eststo M4: xtgls closure i.hos_mode i.hos_power enep party_inst dem_year growth i.el_sys_legis frac_ethn i.precur_regi, c(ar1) p(het)
eststo M5: xtgls closure i.hos_mode##i.hos_power enep party_inst dem_year growth i.el_sys_legis frac_ethn i.precur_regi, c(ar1) p(het)
eststo M6: xtgls closure i.hos_mode_sys enep party_inst dem_year growth i.el_sys_legis frac_ethn i.precur_regi, c(ar1) p(het)
eststo M7: xtgls closure i.hos_mode_sys share_round1 enep party_inst dem_year growth i.el_sys_legis frac_ethn i.precur_regi, c(ar1) p(het)

estout M4 M5 M6 M7 using tab2.doc, c(b(fmt(2) star) se(par fmt(2))) starl(+ 0.1 * 0.05 ** 0.01) eqlab(,none) s(rho chi2, fmt(2 0)) replace


* Table A1

tabstat year if closure<., s(min max n) by(polity) noto


* Figure A1

tw con closure year_frac if country!="Armenia", by(country, note("") graphr(fc(white))) cmiss(n) clw(medthick) clc(black) xti("") yti("Party-system closure", size(vsmall)) xlab(1850(50)2000, labs(medium)) ylab(25(25)100, labs(medium) format(%9.0f)) mcol(black) msize(.15) xli(1850 1900 1950 2000, lp(shortdash) lc(ltblue))

gr export figA1.png, replace


* Table A2

sum closure hos_mode i.hos_mode_sys2 i.hos_mode_sys enep party_inst hos_power dem_year growth el_sys_legis frac_ethn i.precur_regi share_round1 indep_minis if closure<.
sum hos_power2 if closure<. & hos_power2<2
sum share_round1 if closure<. & hos_mode==1


* Table A3

eststo M1b: xtgls closure i.hos_mode enep party_inst dem_year growth i.el_sys_legis frac_ethn i.decade i.polity, c(ar1) p(het)
eststo M2b: xtgls enep i.hos_mode dem_year growth i.el_sys_legis frac_ethn i.decade i.polity if closure<., c(ar1) p(het)
eststo M3b: xtgls party_inst i.hos_mode dem_year growth i.el_sys_legis frac_ethn i.decade i.polity if closure<., c(ar1) p(het)
eststo M1c: xtgls closure i.hos_mode##i.pre1939 enep party_inst dem_year growth i.el_sys_legis frac_ethn i.polity, c(ar1) p(het)

estout M1b M2b M3b M1c using tabA3.doc, c(b(fmt(2) star) se(par fmt(2))) starl(+ 0.1 * 0.05 ** 0.01) eqlab(,none) s(rho chi2, fmt(2 0)) replace


* Table A4

eststo M8: xtgls closure i.hos_mode_sys2 enep party_inst dem_year growth i.el_sys_legis frac_ethn i.precur_regi, c(ar1) p(het)
eststo M9: xtgls enep i.hos_mode_sys2 dem_year growth i.el_sys_legis frac_ethn i.precur_regi if closure<., c(ar1) p(het)
eststo M10: xtgls party_inst i.hos_mode_sys2 dem_year growth i.el_sys_legis frac_ethn i.precur_regi if closure<., c(ar1) p(het)

estout M8 M9 M10 using tabA4.doc, c(b(fmt(2) star) se(par fmt(2))) starl(+ 0.1 * 0.05 ** 0.01) eqlab(,none) s(rho chi2, fmt(2 0)) replace


* Table A5

eststo M8b: xtgls closure i.hos_mode_sys2 enep party_inst dem_year growth i.el_sys_legis frac_ethn i.decade i.polity, c(ar1) p(het)
eststo M9b: xtgls enep i.hos_mode_sys2 dem_year growth i.el_sys_legis frac_ethn i.decade i.polity if closure<., c(ar1) p(het)
eststo M10b: xtgls party_inst i.hos_mode_sys2 dem_year growth i.el_sys_legis frac_ethn i.decade i.polity if closure<., c(ar1) p(het)

estout M8b M9b M10b using tabA5.doc, c(b(fmt(2) star) se(par fmt(2))) starl(+ 0.1 * 0.05 ** 0.01) eqlab(,none) s(rho chi2, fmt(2 0)) replace


* Table A6

eststo M11: xtgls closure i.hos_mode_sys##i.hos_power share_round1 enep party_inst dem_year growth i.el_sys_legis frac_ethn i.precur_regi, c(ar1) p(het)
eststo M12: xtgls closure i.hos_mode_sys3##i.hos_power share_round1 enep party_inst dem_year growth i.el_sys_legis frac_ethn i.precur_regi, c(ar1) p(het)

estout M11 M12 using tabA6.doc, c(b(fmt(2) star) se(par fmt(2))) starl(+ 0.1 * 0.05 ** 0.01) eqlab(,none) s(rho chi2, fmt(2 0)) replace


* Figure A2 and A3

est res M11
eststo marg1: margins, dydx(hos_mode_sys) at(hos_power=0) post
est res M11
eststo marg2: margins, dydx(hos_mode_sys) at(hos_power=1) post
est res M11
eststo marg3: margins, dydx(hos_power) at(hos_mode_sys=(0 1 2 3)) post

coefplot (marg1, lab("Figurehead president") mc(gray) ciop(lc(gray gray))) (marg2, lab("Executive president") mc(black) ciop(lc(black black))), levels(95 90) coeflab(1.hos_mode_sys = "Majority election, single round" 2.hos_mode_sys = "Majority election, two rounds" 3.hos_mode_sys = "Plurality/STV election") xlab(-12(2)10) xli(0, lp(shortdash)) grid(between) xsize(4) ysize(1.8) scale(1.4) legend(pos(6) col(2)) graphr(fcol(white) lc(black))

gr export figA2.png, replace

coefplot marg3, levels(95 90) coeflab(1._at = "Parliamentary" 2._at = "Majority election, single round" 3._at = "Majority election, two rounds" 4._at = "Plurality/STV election") xlab(-16(2)10) xli(0, lp(shortdash)) mc(black) ciop(lc(black black)) grid(between) xsize(4) ysize(1.8) scale(1.4) graphr(fcol(white) lc(black))

gr export figA3.png, replace


* Figure A4 and A5

est res M12
eststo marg1: margins, dydx(hos_mode_sys3) at(hos_power=0) post
est res M12
eststo marg2: margins, dydx(hos_mode_sys3) at(hos_power=1) post
est res M12
eststo marg3: margins, dydx(hos_power) at(hos_mode_sys3=(0 1 2)) post

coefplot (marg1, lab("Figurehead president") mc(gray) ciop(lc(gray gray))) (marg2, lab("Executive president") mc(black) ciop(lc(black black))), levels(95 90) coeflab(1.hos_mode_sys3 = "Majority election, single round" 2.hos_mode_sys3 = `""Final round bound to be decisive" "(Majority election, two rounds" "or Plurality/STV election)""') xlab(-12(2)10) xli(0, lp(shortdash)) grid(between) xsize(4) ysize(1.5) scale(1.7) legend(pos(6) col(2)) graphr(fcol(white) lc(black))

gr export figA4.png, replace

coefplot marg3, levels(95 90) coeflab(1._at = "Parliamentary" 2._at = "Majority election, single round" 3._at = `""Final round bound to be decisive" "(Majority election, two rounds" "or Plurality/STV election)""') xlab(-16(2)10) xli(0, lp(shortdash)) mc(black) ciop(lc(black black)) grid(between) xsize(4) ysize(1.5) scale(1.7) graphr(fcol(white) lc(black))

gr export figA5.png, replace


* Table A7

eststo M1d: xtgls indep_minis i.hos_mode enep party_inst dem_year growth i.el_sys_legis frac_ethn i.precur_regi if closure<., c(ar1) p(het)
eststo M8d: xtgls indep_minis i.hos_mode_sys2 enep party_inst dem_year growth i.el_sys_legis frac_ethn i.precur_regi if closure<., c(ar1) p(het)
eststo M4d: xtgls indep_minis i.hos_mode i.hos_power enep party_inst dem_year growth i.el_sys_legis frac_ethn i.precur_regi if closure<., c(ar1) p(het)
eststo M5d: xtgls indep_minis i.hos_mode##i.hos_power enep party_inst dem_year growth i.el_sys_legis frac_ethn i.precur_regi if closure<., c(ar1) p(het)
eststo M6d: xtgls indep_minis i.hos_mode_sys enep party_inst dem_year growth i.el_sys_legis frac_ethn i.precur_regi if closure<., c(ar1) p(het)
eststo M7d: xtgls indep_minis i.hos_mode_sys share_round1 enep party_inst dem_year growth i.el_sys_legis frac_ethn i.precur_regi if closure<., c(ar1) p(het)

estout M1d M8d M4d M5d M6d M7d using tabA7.doc, c(b(fmt(2) star) se(par fmt(2))) starl(+ 0.1 * 0.05 ** 0.01) eqlab(,none) s(rho chi2, fmt(2 0)) replace


* Figure A6

hist prespow2 if closure<., percent xlab(0(.25)1, labs(5) nogrid) ylab(0(5)15, labs(5) gstyle(major) gmax) xti(Doyle/Elgie index, size(6)) xsc(titlegap(2) noline) ysc(titlegap(2) noline) yti("Percent of cases", size(6)) col(gray) bin(25) graphr(fc(white))

gr export figA6.png, replace


* Table A8

eststo M4e: xtgls closure i.hos_mode i.hos_power2 enep party_inst dem_year growth i.el_sys_legis frac_ethn i.precur_regi, c(ar1) p(het)
eststo M5e: xtgls closure i.hos_mode##i.hos_power2 enep party_inst dem_year growth i.el_sys_legis frac_ethn i.precur_regi, c(ar1) p(het)

estout M4e M5e using tabA8.doc, c(b(fmt(2) star) se(par fmt(2))) starl(+ 0.1 * 0.05 ** 0.01) eqlab(,none) s(rho chi2, fmt(2 0)) replace

